#pragma once

//=======================================================================================
// @bsiclass                                               Y.Dong          10/2014
//=======================================================================================

class DcDrawUtils
{
public:
    struct DcPoint2d
    {
        double x;
        double y;
        const DcPoint2d& operator =(const DcPoint2d &s)
        {
            x = s.x;
            y = s.y;
            return *this;
        };

        DcPoint2d()
        {
        };

        DcPoint2d(double x1,double y1)
        {
            x = x1;
            y = y1;
        };

        DcPoint2d(const DcPoint2d& s)
        {
            x = s.x;
            y = s.y;
        };

    };

    DcDrawUtils();
    ~DcDrawUtils();
    static void SetDrawExtend(double xmin, double ymin, double xmax, double ymax);
    static void GetScaleForDC();
	static BOOL SetDcPar(CStatic* pStaShow, CClientDC** pDC, double sideWid);
    static void PointToDC(DcPoint2d pt, DcPoint2d& result);
    static void DrawLineOnDC(CClientDC *pDC, DcPoint2d ps, DcPoint2d pe, long clr = RGB(0,0,0), int lweight = 1);

    static void DrawRectOnDC(CClientDC* pDC, DcPoint2d ps, DcPoint2d pe, long clr = RGB(0, 0, 0), int lweight = 1);
    static int GetInt(double x);
    static BOOL SetDcParGray(CStatic *pStaShow, CClientDC **pDC, double sideWid);
    static void DrawPoint(CClientDC* pDC, DcPoint2d pt, float d);
	static void DrawPlineOnDC(CClientDC *pDC, vector<DcPoint2d> &PtList, long clr = RGB(0, 0, 0), int lweight = 1, bool bClose = true);

	//static void DrawArrow(CClientDC* pDC, DcPoint2d ps, DcPoint2d pe, double lenArrow, long clr, int lweight);
	static void DimOnDC(DcPoint2d p1, DcPoint2d p2, DcPoint2d p3, CString csText, float height, float d, CClientDC *pDC);
	static void DrawTextOnDC(CClientDC *pDC, DcPoint2d p1, float height, CString cs, long Col, float ang = 0);
    static double DcDistanceToWorld(double DcDis);
    static void DrawBitMap(CWnd* pWnd, CBitmap& bmp);
	static void PaintColorOnRect(CDC *pDC, CRect rc, COLORREF col, bool bNeedOutRect = true, COLORREF colRec = RGB(6, 6, 6));
	static void DrawConstructBmp(CDC* pDC, CRect recImage, CString consName);
	static void DrawMatBmp(CDC* pDC, CRect recImage, CString matName);
};
